package com.daocheng.weblog.common.domain.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.daocheng.weblog.common.domain.dos.UserRoleDO;

import java.util.List;

/**
 * @ClassName UserRoleMapper
 * @author: 稻城
 * @date: 2025/3/5
 * @Version 1.0
 * @description: TODO
 */
public interface UserRoleMapper extends BaseMapper<UserRoleDO> {
    /**
     * @param username
     * @return List<UserRoleDO>
     * @author 稻城
     * @Date 2025/3/5 21:41
     * @description 根据用户名查询相关角色
     */
    default List<UserRoleDO> findByUsername(String username) {
        return selectList(new LambdaQueryWrapper<UserRoleDO>().eq(UserRoleDO::getUsername, username));
    }
}
